package cn.DynamicDataSource;

public class DynamicDataSourceHolder {

    //解决线程安全问题
    private static final ThreadLocal<String> holder = new ThreadLocal<String>();

    public static void putDataSourceName(String dataName) {
        holder.set(dataName);
    }

    public static String getDataSourceName() {
        return holder.get();
    }

    public static class DataSourceName {
        public final static String dataSource = cn.DynamicDataSource.DataSourceName.PRIMARYDATASOURCE.getValue();
    }
}